#include "facedetector.h"
#include <QApplication>
#include "login.h"
#include "adminui.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Login login_page;
    FaceDetector w;
    adminUI admin;
    login_page.show();
    w.hide();
    admin.hide();
    QObject::connect(&login_page, &Login::login_success, &w, [&](int id){
        w.setID(id);
        w.show();
    });
    QObject::connect(&w, &FaceDetector::back, &login_page, [&](){
        login_page.show();
    });
    QObject::connect(&login_page, &Login::admin_login_success, &admin, [&](){
        admin.show();
    });
    QObject::connect(&admin, &adminUI::back, &login_page, [&](){
        login_page.show();
    });
    return a.exec();
}
